package com.fclassroom.logger.iInterface;

import java.util.ArrayList;

import com.aliyun.openservices.log.Client;
import com.aliyun.openservices.log.common.LogItem;

/**
 * 阿里日志服务sls接口
 * 
 * @author zb
 * @Time 2017年4月26日 下午5:01:02
 */
public interface IAliLogService {
	/**
	 * 保存日志到阿里日志服务
	 * 
	 * @param logMsg
	 */
	public void insertLogToDB(String logMsg);

	/**
	 * 保存日志到阿里日志服务
	 * 
	 * @param client
	 * @param project
	 * @param logstoreName
	 * @param topic
	 * @param source
	 * @param logMsg
	 */
	public void insertLogToSLS(Client client, String project, String logstoreName, String topic, String source,
			String logMsg);

	/**
	 * 保存日志到阿里日志服务
	 * 
	 * @param client
	 * @param project
	 * @param logstoreName
	 * @param topic
	 * @param source
	 * @param logMsg
	 */
	public void insertLogListToSLS(Client client, String project, String logstoreName, String topic, String source,
			String logMsg);

	/**
	 * 获取sls项目日志库列表
	 * 
	 * @param project
	 * @param offset
	 * @param size
	 *            大小
	 * @param logStoreName
	 *            日志库名称
	 * @return
	 */
	public ArrayList<String> getLogStores(Client client, String project);
	/**
	 * 获取sls项目日志库列表
	 * 
	 * @param project
	 * @param offset
	 * @param size
	 *            大小
	 * @param logStoreName
	 *            日志库名称
	 * @return
	 */
	public ArrayList<String> getLogTopics(Client client, String project,String logstore);
	/**
	 * 获取time到现在的时间段,某个分区的写入数据
	 * 
	 * @param client
	 * @param project
	 *            项目
	 * @param logstoreName
	 *            日志库名称
	 * @param shard_id
	 *            分区
	 * @param time
	 */
	public void getLogItem(Client client, String project, String logstoreName, int shard_id, String time);

	/**
	 * Get The sub set of logs data from log service server which match input
	 * parameters. By default, it will return at most 20 lines
	 * 
	 * @param client
	 * @param project
	 * @param logstoreName
	 * @param from
	 *            the begin time of the result data to get
	 * @param to
	 *            the end time of the result data to get
	 * @param query
	 */
	public void getLogsByTopic(Client client, String project, String logstoreName, String from, String to, String topic,
			String query);
}
